package com.echo.controller;

import com.echo.common.utils.AuthorizationUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//权限控制测试controller
@RestController
@RequestMapping("/test")
public class AuthController {

    private AuthorizationUtil authorizationUtil;

    public AuthController(AuthorizationUtil authorizationUtil) {
        this.authorizationUtil = authorizationUtil;
    }

    @RequestMapping("/testAuth")
    public String testAuth(){
        boolean b = authorizationUtil.authorityJudgement(1);
        if (b){
            return "yes";
        }
        return "no";
    }
}
